Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(util): change traversal strategy in root_pattern #3552

Closed
wants to merge 1 commit into from

Conversation

Yanguk
Copy link

@Yanguk Yanguk commented Jan 10, 2025

In the previous implementation, there was a priority order in defining the root_file.
I have modified it to give priority to the configuration file that is closer to the current directory.

For example

local root_file = {
  '.eslintrc',
  '.eslintrc.js',
  '.eslintrc.cjs',
  '.eslintrc.yaml',
  '.eslintrc.yml',
  '.eslintrc.json',
  'eslint.config.js',
  'eslint.config.mjs',
  'eslint.config.cjs',
  'eslint.config.ts',
  'eslint.config.mts',
  'eslint.config.cts',
}

In the case where it runs from monorepo/packages/something,
if both monorepo/packages/something/eslint.config.js and monorepo/.eslintrc exist, the execution root is currently set to monorepo.

However, I believe that the closer file monorepo/packages/something/eslint.config.js should be prioritized, and the execution root should be monorepo/packages/something instead of monorepo.

@Yanguk Yanguk requested a review from glepnir as a code owner January 10, 2025 15:37
@Yanguk Yanguk changed the title refactor(util): change traversal method for root_pattern refactor(util): change traversal strategy in root_pattern Jan 11, 2025
@Yanguk Yanguk closed this Jan 11, 2025
@Yanguk
Copy link
Author

Yanguk commented Jan 11, 2025

#3321

This PR duplicates the other one.

@Yanguk Yanguk deleted the util branch January 14, 2025 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant